package com.android.assignment.taskreminder;

import android.app.Dialog;
import android.app.TimePickerDialog;
import android.app.TimePickerDialog.OnTimeSetListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;

public class TimePickerDialogFragment extends DialogFragment {

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		Bundle args = getArguments();
		Fragment editFragment = getFragmentManager().findFragmentByTag(
				TaskReminderEditFragment.DEFAULT_EDIT_FRAGMENT_TAG);
		OnTimeSetListener listener = (OnTimeSetListener) editFragment;
		return new TimePickerDialog(getActivity(), listener,
				args.getInt(TaskReminderEditFragment.HOUR),
				args.getInt(TaskReminderEditFragment.MINS), false);
	}
}
